package tech.aistar.design.proxy.dynamic;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 本类用来演示:
 *
 * @author: success
 * @date: 2021/3/25 2:39 下午
 */
public class TestLIst {
    public static void main(String[] args) {
        //得到的是一个代理对象
        List<String> list = Arrays.asList("a","b","v");
        System.out.println(list.getClass());//class java.util.Arrays$ArrayList

        list.remove(1);//java.lang.UnsupportedOperationException
        System.out.println(list);

        List<String> stringList = new ArrayList<>();
        stringList.add("a");
        stringList.add("b");
        stringList.add("c");
        System.out.println(stringList.getClass());//class java.util.ArrayList

        stringList.remove(1);
        System.out.println(stringList);
    }
}
